from __future__ import division
from jinja2.runtime import LoopContext, TemplateReference, Macro, Markup, TemplateRuntimeError, missing, concat, escape, markup_join, unicode_join, to_string, TemplateNotFound
name = '/admin/published.html'

def root(context, environment=environment):
    parent_template = None
    block_context = context._block()
    if 0: yield None
    parent_template = environment.get_template('blog/admin/base.html', '/admin/published.html')
    for name, parent_block in parent_template.blocks.iteritems():
        context.blocks.setdefault(name, []).append(parent_block)
    for event in parent_template.root_render_func(context):
        yield event

def block_body(context, environment=environment):
    l_post = context.resolve('post')
    l_draft = context.resolve('draft')
    if 0: yield None
    yield u'\n<div class="block">\n\t<div class="hd">\n  \t\t<h2>Admin: Publishing post.</h2>\n\t</div>\n\t<div class="bd">\n  '
    if environment.getattr(l_post, 'published'):
        if 0: yield None
        yield u'\n    '
        if l_draft:
            if 0: yield None
            yield u'\n      <p>Your changes have been saved (but not published)</p>\n    '
        else:
            if 0: yield None
            yield u'\n      <p>Your post has been published!</p>\n      <p><a href="%s">View your post</a></p>\n    ' % (
                escape(environment.getattr(l_post, 'path')), 
            )
        yield u'\n  '
    else:
        if 0: yield None
        yield u'\n    <p>Your draft post has been saved.</p>\n  '
    yield u'\n\t</div>\n</div>\n'

def block_title(context, environment=environment):
    if 0: yield None
    yield u'Admin: Publishing Post'

blocks = {'body': block_body, 'title': block_title}
debug_info = '1=9&3=15&9=20&10=23&12=28&14=29&15=31&16=34&18=35&2=37'